Flow control and error handling for Node.js