Implemented pagination with MongoDB