Added the function to contact the database with in main.js.