I've just been fixing a bug in module.exports.createAlbum in functions/albums.js. When the call fails, it calls res.end(error). But since the error was returned from an SQL query, there's no guarantee that it's a string. Since it's not a string, and res.end expects a string, the server crashes.
I've fixed the bug in albums.js, but a quick glance suggests that we call res.end(error) a lot.