There many way setup it, if you want to simple to do that just insert code below into file index.php

    $response = new Phalcon\Http\ResponseResponse();

if you want to some complex such as handle the 404 (Not Found) and 500 (Internal Server Error) within the application. There's a service you can use which basically you can override key parts of the event management system. You'll want to hook into the 'dispatch:beforeException' event, and tell the application to do something else.

    //Registering a dispatcher
        $di->set('dispatcher', function() {
            //Create/Get an EventManager
            $eventsManager = new \Phalcon\Events\Manager();
            //Attach a listener
            $eventsManager->attach("dispatch", function($event, $dispatcher, $exception) {
                //controller or action doesn't exist
                if ($event->getType() == 'beforeException') {
                    switch ($exception->getCode()) {
                        case \Phalcon\Dispatcher::EXCEPTION_HANDLER_NOT_FOUND:
                        case \Phalcon\Dispatcher::EXCEPTION_ACTION_NOT_FOUND:
                                'controller' => 'index',
                                'action' => 'notFound'
                            return false;

            $dispatcher = new \Phalcon\Mvc\Dispatcher();
            //Set default namespace to frontend module
            //Bind the EventsManager to the dispatcher

            return $dispatcher;

Text Snippet:

    \Phalcon\Mvc\Dispatcher::EXCEPTION_HANDLER_NOT_FOUND  - code 2

or Text Snippet:

    \Phalcon\Mvc\Dispatcher::Dispatcher::EXCEPTION_ACTION_NOT_FOUND - code 5

Then my ErrorController:

    class ErrorController extends \Phalcon\Mvc\Controller
      public function notFoundAction()
          // The response is already populated with a 404 Not Found header.

      public function uncaughtExceptionAction()
          $this->response->setStatusCode(500, 'Internal Server Error');