Add middlewares and prepare first view.