documented the database insertion functionality on index.js