moved middlewares to app/middlewares, and moved tests