Replaced Group.as_json with faster jBuilder template. Updated JS models to include group counts.