Not very clear on the question but there is a countQuery variable that took the same sql query but with a count instead to handle pagination. Also, the sorting is based of what the client request contains but there is a default in the sql too for situations where the client doesn't specify.
Banabas Ave Abadu
Shouldn't the simplifiedList response be sorted before extracting the sublist to be sure of consistent results. Or is this handled in the customQuery