optimize json, some client side stuff