refactored backend.js
add utils to populate database
change try catch for a better case handling