update pagination methods to utilize search and order the results.

optimized data fetching.