title: Invalid Api key using RestServer
body: <p>I am using <a href="https://github.com/chriskacerguis/codeigniter-restserver" rel="nofollow">the codeigniter rest server api library.</a></p>
  
  <p>When I enter <a href="http://localhost/projects/myapi/key/index_put.php" rel="nofollow">http://localhost/projects/myapi/key/index_put.php</a> and hit enter gives me the following error:</p>
  
  <pre><code>&lt;xml&gt;
  &lt;status&gt;0&lt;/status&gt;
  &lt;error&gt;Invalid API Key&lt;/error&gt;
  &lt;/xml&gt;
  </code></pre>
  
  <p>When I give a dummy string in the url, like:</p>
  
  <p><a href="http://localhost/projects/myapi/key/index_put.php?X-API-KEY=asldfj9alsdjflja97979797997" rel="nofollow">http://localhost/projects/myapi/key/index_put.php?X-API-KEY=asldfj9alsdjflja97979797997</a></p>
  
  <p>I get the same problem. Any idea?</p>
  
  <p><code>index_put.php</code>:</p>
  
  <pre><code>public function index_put() {
          // Build a new key
          $key = self::_generate_key();
          // If no key level provided, give them a rubbish one
          $level = $this-&gt;put('level') ? $this-&gt;put('level') : 1;
          $ignore_limits = $this-&gt;put('ignore_limits') ? $this-&gt;put('ignore_limits') : 1;
  
          // Insert the new key
          if (self::_insert_key($key, array('level' =&gt; $level, 'ignore_limits' =&gt; $ignore_limits))) {
              $this-&gt;response(array('status' =&gt; 1, 'key' =&gt; $key), 201); // 201 = Created
          } else {
              $this-&gt;response(array('status' =&gt; 0, 'error' =&gt; 'Could not save the key.'), 500); // 500 = Internal Server Error
          }
      }
  </code></pre>