server side generation of optimized JSON