FIXED db.js added callbacks, not 100% sure whether it is working correctly