Query should return array of resources not an object