Added JSON content-type handling and JSON result