Added paging to the query service.