Added DB API

for integrity control.