added middleware and turned of debug in settings (the one for the server)