finish grouping for group toJSON