update api context