Added support for JSON input on the request. This required changing the request body to parse and flatten the JSON to look like POST data.