Added HEAD support, sync middlewares, and pattern paths