Added rails JSON response to grouping request (with passing tests)