Have the ListResources support the Countable interface, so you can easily retrieve the total number of items. This is the dumbest possible implementation, with no caching and one cheap API request made for the total number of resources.
Support the count() interface
Catch exceptions and return 0 instead of null
Add an extra test if the total() is missing.
Add inline documentation
inline the page totals