Update index.js

correctly handle rendering errors
Merge pull request #2 from mako-taco/master

Properly handle passing error messages to res.end