Move errors to routes/lib/errors.js.