Topic/fix paging

Restored the paging, which got lost somewhere a while ago and added the needed tests.