Paginate list groups endpoint part 1 (ready for review)

These are just the random additions (helper functions, config file changes) that will handle query args and produce next page links in the api endpoints.

The PR gets too big with the added list group + tests + cloudcafe changes :|  (also happy to re-group some of these changes elsewhere)