Add a loadMiddlewares method on application