Ensure the JSON object we receive is a Hash.
  Return 500 status code on malformed JSON.
  Return HTTP status code 500 on error.