added pagination to category and index