updated db models and added test script