add pagination and sorting to index results