private function initEvents()
{
$this->router->on('NotFound', function ($request, $response, $next) {
$response->write('Not found');
$response->setStatus(404);
$next();
});
$this->router->on('MethodNotAllowed', function ($request, $response, $next) {
$response->write('Method Not Allowed');
$response->setStatus(405);
$next();
});
}