add some tests, finish resource and dao