format json output to pretty stle. optimize interface