added URL query parameter of "pretty=true" to output formatted json 

Just `if prettyPrint {` should be fine