Added JSON output support.