fixing DAO and server and added DAO unit test