WIP groups: API addition

@hachreak  is right. The `api` should not use `Flask.request` inside functions.