add query to context of api calls