Implemented JSON output.