modify handlers to accept query string

I think ``groups`` should be named ``group`` since it's just one group? We can maybe shift the calculation of ``next_cursor`` up and use it in the construction of the group too?