Adding support for JSON output.