More tests, refactored exception, fixed server.js