Paging logic in controller
Added test / fixed broken tests