Added JSON out functionality.