Adding JSON output to the API.