Rework building the uri to enable pagination to properly implemented