Pretty print json in debug mode

In debug mode and if available pretty-print json responses. It makes debugging and documenting easier