This line is a bit confusing to me. Maybe

```js
res.send({'success': false, 'message': msg});
```
could be better?