@viart could be 
```if(err) {
response.write(...); 
} else {
response.write(...); } 
response.end();```