Optimized group JSON rendering to reduce database load