Fixed broken commit, added tests.

Run tests with 'npm test'
Tests are to make sure it actually runs, and to make sure future backend
bugs are fixed.