Add some more debugging to REST DAO and fix tests