HACK: temporary fixes for tests related to new `resource-class`
Basic support for "order by" via query parameter

Currently only applied to new `event-counts` endpoint, but
should work fine on any other endpoints with a small
change.
Add initial support for paged queries

Only used by new `event-counts` endpoint for now.