ensuring proper data structure return for get_groups()