Pagination implementation
Lots other fixes