split http server into middlewares