Pagination to get the total count in serverside