updated db.js- graceful shutdown; linked to nursinghomes.js