server and middleware