Pagination class and example controller