Paginate list groups endpoint part 1 (ready for review)

These are just the random additions that will handle query args and produce next page links in the api endpoints.