Added outputting of JSON.