added pretty printed json2 encode