Adding error handling to request for node.js - closes #18