add middleware to handle 401 error.
Install mkdirp package.
modify routes.js.