Move all api query code into the ApiRequest object