@Override
    public void channelRead0(ChannelHandlerContext ctx, FullHttpRequest request) throws Exception {
        //Check for bad Request
        if (!request.getDecoderResult().isSuccess()) {
            HandlerUtil.sendError(ctx, BAD_REQUEST);
            return;
        }

        //Check for correct HTTP Method (only GET and POST should work)
        if (request.getMethod() != GET && request.getMethod() != POST) {
            HandlerUtil.sendError(ctx, METHOD_NOT_ALLOWED);
            return;
        }

        //Check which handler should handle it
        final String uri = request.getUri();
        String path = HandlerUtil.sanitizeUri(uri);
        if (path == null) {
            HandlerUtil.sendError(ctx, FORBIDDEN);
            return;
        }

        path = path.split("\\?")[0];

        request.setUri(path);

        for(Map.Entry<String, IHandler> handler : handlers.entrySet()) {
            Pattern pattern = Pattern.compile(handler.getKey());

            if(pattern.matcher(uri).find()) {
                handler.getValue().handle(ctx, request);
                return;
            }
        }

        HandlerUtil.sendError(ctx, INTERNAL_SERVER_ERROR);
    }