fix db bugs
add test client