updated defaults values and added middlewares for authentication