title: Expected response to contain an object but got an array for GET action
body: <p>I'm getting this error "<code>Error: [$resource:badcfg] Error in resource configuration for action 'get'. Expected response to contain an object but got an array</code>"</p>
  
  <p>and I don't know how to fix it. I have this service</p>
  
  <pre><code>angular.module('messages').factory('Messages', ['$resource',
      function ($resource) {
          return $resource('api/messages/:username', {
              username: '@username'
          });
      }]);
  </code></pre>
  
  <p>and this in controller:</p>
  
  <pre><code>    $scope.findOne = function () {
          $scope.messages = Messages.get({
              username: $routeParams.username
          });
  
          console.log($scope.messages);
      };
  </code></pre>
  
  <p>For this route I have in API controller this</p>
  
  <pre><code>exports.read = function (req, res) {
      res.json(req.message);
  };
  </code></pre>
  
  <p>I know that I have to use $resource action isArray = true, but I don't know where to put it. I tried to do something like this:</p>
  
  <pre><code>angular.module('messages').factory('Messages', ['$resource',
      function ($resource) {
          return $resource('api/messages/:username', {
              username: '@username'
          }, 
              {'query': {method: 'GET', isArray: true}});
      }]);
  </code></pre>
  
  <p>but without result and still same error.</p>