complete DB functionallity