db integration nearly done