[api] Fix bug in group creation