fix 'curl' command output

now pretty-prints JSON output, and otherwise prints the response body