Make node server error handling more robust