added paginated api query