adding db interface and callback funcs