Update index.js

Changed formatError(err) reference to be correctly scoped. Should perhaps change the res.end message. Not sure how useful that will be for end users. This way currently passes unit tests, however.