Handling sorting with server side pagination