title: What MIME type if JSON is being returned by a REST API?
body: <p>My REST API returns JSON. </p>
  
  <p>I'm currently returning text/plain as the MIME type, but it feels funny.
  Should I be returning <code>application/x-javascript</code> or some other type?</p>
  
  <p>The second question is with regard to the HTTP status code for error conditions.
  If my REST API is returning an error state, I am returning as JSON</p>
  
  <pre><code>{ result: "fail", errorcode: 1024, errormesg: "That sucked. Try again!" }
  </code></pre>
  
  <p>Should the HTTP status code remain at <code>200 OK</code>?</p>