Implement exceptions for node.js backend