generate json with groups and group_leaders