在Codeigniter Restful服务器中加载模型功能

Recently i started width Codeigniter Restful server. I use the following script: https://github.com/philsturgeon/codeigniter-restserver.

If i trying to get a property of my model, the Rest server returns NULL. In a normal CI controller this function works. The code is:

require(APPPATH.'/libraries/REST_Controller.php'); 
class Api extends REST_Controller
{
    function user_post()  
    {  
        $username = $this->post('username');
        $password = $this->post('password');
        $company_code = $this->post('company_code');
        $key = $this->post('key');
        $this->CI =& get_instance();

        // Load user model
        $this->load->model('User_model');
        $this->load->model('Api_model');

        // Ip adres remote server
        $server_ip  = $_SERVER['REMOTE_ADDR'];

        // Ophalen data
        $user = $this->User_model->getApiLogin($username,$password);

The error eccors on the last line: $user = $this->User_model->getApiLogin($username,$password);

The Api is called through Curl:

             $key = 'Test';
         $company_code = 'econome';  
         $username = 'jellepals';  
         $password = 'test';  

         $curl_handle = curl_init();  
         curl_setopt($curl_handle, CURLOPT_URL, 'http://jelle.testapiserver.nl/api/user/format/json');
         //curl_setopt($curl_handle, CURLOPT_VERBOSE, true);
         //curl_setopt($curl_handle, CURLOPT_FOLLOWLOCATION, true);             
         curl_setopt($curl_handle, CURLOPT_RETURNTRANSFER, 1);  
         curl_setopt($curl_handle, CURLOPT_POST, 1);  
         curl_setopt($curl_handle, CURLOPT_POSTFIELDS, array(  
             'key' => $key,  
             'username' => $username,
             'password' => $password));  
         $buffer = curl_exec($curl_handle);  
         curl_close($curl_handle);  
         $result = json_decode($buffer);  
         var_dump($result);

Does somebody know how i can call a model function in a Restserver? Thanks!

I think the problem is in my db connexion. Someone build an extra layer betweeen db class and the model called Db_handler.php. When calling from the api this layer doesn,t work apparently. With this layer we can use multiple databases. When adding this:

   var $db;

    public function __construct() {
        parent::__construct();
        $this->db = $this->load->database($this->config->item('default', 'database'), TRUE);
    }

To my model the connexxion works fine.

Thanks for rhe comment MDeSilva.

Simply like this

$this->load->model('category_model');
$categories = $this->category_model->get_categories_api($language_code);

Try to load models like this (first letter of the model is simple)

    $this->load->model('user_model');
    $this->load->model('api_model');