add pagination to API