title: Cannot respond with 404 in HEAD request
body: <p>I'm unable to respond with a 404 not found when implementing a <code>HEAD</code> request in apigility.
  Apigility handles <code>HEAD</code> request with the same resource method as <code>GET</code> requests by default. This is the <code>fetch($id)</code> method.</p>
  
  <p>My resource looks like this:</p>
  
  <pre><code>class MyResource extends AbstractResourceListener implements ResourceInterface
  {
      public function fetch($id)
      {
          $entity = $this-&gt;getEntityById($id, false);
          if ($entity === null) {
              return new ApiProblemResponse(new ApiProblem(404, 'Entity with ID ' . $id . ' not found'));
          }
  
          return $entity;
      }
  }
  </code></pre>
  
  <p>When accessing the resource with a REST client using a <code>HEAD</code> I get a 200 OK. I can confirm the <code>ApiProblemResponse</code> is returned from the method.
  Requesting the resource using a <code>GET</code> I get a 404 response as expected. </p>
  
  <p>It seems to be related to the handling of <code>HEAD</code> and <code>GET</code> in the <code>AbstractRestfulController</code>. Here is a code snippet of the related code:</p>
  
  <pre><code>case 'get':
      $id = $this-&gt;getIdentifier($routeMatch, $request);
      if ($id !== false) {
          $action = 'get';
          $return = $this-&gt;get($id);
          break;
      }
      $action = 'getList';
      $return = $this-&gt;getList();
      break;
  // HEAD
  case 'head':
      $id = $this-&gt;getIdentifier($routeMatch, $request);
      if ($id === false) {
          $id = null;
      }
      $action = 'head';
      $this-&gt;head($id);
      $response = $e-&gt;getResponse();
      $response-&gt;setContent('');
      $return = $response;
      break;
  </code></pre>
  
  <p>In the get implementation the result from the resourceListener method is returned as the application response. This seems correct to me.
  In the head implementation the MvcEvent response is used, thus ignoring the <code>ApiProblemResponse</code> I return from the resourceListener. I'm unable to access the <code>MvcEvent</code> from my <code>ResourceListener</code>.</p>
  
  <p>Does anyone have a solution to be able to return a 404 for a <code>HEAD</code> request?</p>