Improve client db

this adds the functionality mentioned in #7