fixed main by making it run migration first, and then running the server