title: What is a right way for REST API response?
body: <p>What is a best practice for REST API response structure and layout?</p>
  
  <p>Example of scrath:</p>
  
  <p><strong>Success response</strong>:</p>
  
  <pre><code>{
      "status": "success",
      "data": # some data here
  }
  </code></pre>
  
  <p><strong>Fail response</strong>:</p>
  
  <pre><code>{
      "status": "fail",
      "data": {
          "code": # some error code,
          "message": # some error explaining message
      }
  }
  </code></pre>