added support for JSON output
added API reference