title: Codeigniter Restful API not working
body: <p>I have a Codeigniter setup where I installed the Restful API thing. I created an API-folder in my <code>application-&gt;controller-&gt;api</code> and after that i created an API which looks like this:</p>
  
  <pre><code>&lt;?php
  
  require(APPPATH.'libraries/REST_Controller.php');
  
  class Allartists extends REST_Controller{
  
  function artists_get()
  {
      if(!$this-&gt;get('artist_id'))
      {
          $this-&gt;response(NULL, 400);
      }
  
      $artists = $this-&gt;artist_model-&gt;get( $this-&gt;get('artist_id') );
  
      if($artists)
      {
          $this-&gt;response($artists, 200);
      }
      else
      {
          $this-&gt;response(array('error' =&gt; 'Couldn\'t find any artists!'), 404);
      }
  }
  
  ?&gt;
  </code></pre>
  
  <p>In my <code>application-&gt;models</code>-folder I have the file <code>artist_model.php</code> which looks like this:</p>
  
  <pre><code>&lt;?php
  
  Class artist_model extends CI_Model
  {
     function get_all_artists(){
      $this-&gt;db-&gt;select('*');
      $this-&gt;db-&gt;from('artists');
      return $this-&gt;db-&gt;get();
     }
  }
  
  ?&gt;
  </code></pre>
  
  <p>So, when I type <code>http://localhost/myprojects/ci/index.php/api/Allartists/artists/</code> I get <code>400 - Bad Request</code>-error... when I type <code>http://localhost/myprojects/ci/index.php/api/Allartists/artists/artist_id/100</code> I get PHP error <code>Undefined property: Allartists::$artist_model</code> - So what is going on here? </p>