New function for syncing database to existing data in main.py. Minor bugfixing in player.js