Imported the logic for /groups