fix javascript errors caused by an empty database

I don't know backone.js or coffescript at all, so if there's a better solution to the bug then I'm all for that, but this fixed the problem for me.