Fix classpath
rest: Add a unit test and fix bugs found during testing