title: CakePHP REST route does not work
body: <p>I'm trying to build an restfull api with CakePHP, but when I try to get a record, via url /api/categories/1.json, I get the message:</p>
  
  <pre><code>{
  "code": 404,
  "name": "Action CategoriesController::api_1() could not be found.",
  "message": "Action CategoriesController::api_1() could not be found.",
  "url": "\/api\/categories\/1.json"
  }
  </code></pre>
  
  <p>I want to use the prefix "api" for when I want to use the api. It's strange when I use the url /api/categories.json, then it works as expected, which means I get all categories.</p>
  
  <p>Here some code snippets.</p>
  
  <p><strong>routes.php</strong></p>
  
  <pre><code>Router::mapResources('categories');
  Router::parseExtensions('json');
  Router::resourceMap(array(
      array('action' =&gt; 'index', 'method' =&gt; 'GET', 'id' =&gt; false, 'prefix' =&gt; 'api'),
      array('action' =&gt; 'view', 'method' =&gt; 'GET', 'id' =&gt; true, 'prefix' =&gt; 'api'),
      array('action' =&gt; 'add', 'method' =&gt; 'POST', 'id' =&gt; false, 'prefix' =&gt; 'api'),
      array('action' =&gt; 'edit', 'method' =&gt; 'PUT', 'id' =&gt; true, 'prefix' =&gt; 'api'),
      array('action' =&gt; 'delete', 'method' =&gt; 'DELETE', 'id' =&gt; true, 'prefix' =&gt; 'api'),
      array('action' =&gt; 'update', 'method' =&gt; 'POST', 'id' =&gt; true, 'prefix' =&gt; 'api')
  ));
  </code></pre>
  
  <p><strong>CategoriesController.php</strong></p>
  
  <pre><code>class CategoriesController extends AppController {
  
      public $components = array(
          'RequestHandler'
      );
  
      public function api_index() {
          $this-&gt;set('categories', $this-&gt;Category-&gt;find('all'));
      }
  
      public function api_view($id) {
          $category = $this-&gt;Category-&gt;findById($id);
          $this-&gt;set('category', $category);
      }
  }
  </code></pre>
  
  <p><strong>core.php</strong></p>
  
  <pre><code>Configure::write('Routing.prefixes', array('api'));
  </code></pre>
  
  <p><strong>Views</strong></p>
  
  <p>My views are within map View/Categories/json/ and I have named them api_index.ctp and api_view.ctp.</p>