DB work

Updated some database interface.