added db.js for database code