Package iterative query into API.