title: Apigility returning error even after successfull action
body: <p>I am building a REST API using Apigility with Zend Framework 2.
  In this API, I have a code-connected REST service and I am encountering a strange behaviour when I try to delete an entity.
  I use the delete method of my TableGateway object to delete the data passed into the delete method of the "Resource" file:</p>
  
  <pre><code>public function delete($id)
  {
      //GetTable returns a TableGateway instance
      $this-&gt;getTable('order')-&gt;delete(array('id' =&gt; $id));
      return array("status" =&gt; "deleted", "id" =&gt; $id);
  }
  </code></pre>
  
  <p>I tested this function by using the Postman REST client and got back the response:</p>
  
  <pre><code>{
      "type":"http://www.w3.org/Protocols/rfc2616/rfc2616-sec10.html",
      "title":"Unprocessable Entity",
      "status":422,
      "detail":"Unable to delete entity."
  }
  </code></pre>
  
  <p>However, when I checked the mysql database, the entity in question was deleted properly.
  There were no signs of an error occuring.</p>
  
  <p>What could the cause of such an error being returned be?</p>
  
  <p>Update:
  The code reaches the lines after the TableGateway delete function call.
  That means the response is probably built after the function is called and the return value I return is ignored.</p>