public function index() {
        //Ensure the session is started
        Session::start();
        
        //Start the server
        $server=new CodeBankAMFServer();
        
        //Initialize the server classes
        $classes=ClassInfo::implementorsOf('CodeBank_APIClass');
        foreach($classes as $class) {
            //Set the class to be active in the server
            $server->setClass($class);
        }
        
        //Enable Service Browser if in dev mode
        if(Director::isDev()) {
            $server->setClass('ZendAmfServiceBrowser');
            ZendAmfServiceBrowser::$ZEND_AMF_SERVER=$server;
        }
        
        if(class_exists('CodeBankAPITest') && $this->_testAMFRequest!==false) {
            $server->setRequest($this->_testAMFRequest);
            $server->setResponse(new Zend_Amf_Response());
        }
        
        $server->setProduction(!Director::isDev()); //Server debug, bind to opposite of Director::isDev()
        
        //Start the response
        $response=$server->handle();
        
        
        //If not in test mode add the application/x-amf content type
        if(!class_exists('CodeBankAPITest')) {
            $this->response->addHeader('Content-Type', 'application/x-amf');
        }
        
        
        //Save session
        Session::save();
        
        //Output
        return $response;
    }