Seperated main.js into two files. All endpoints work. Figured that it might be better to make one function that does all the api calls and returns a big object rather than having all the logic while the api calls are going. This should be seen in next commit.
Organized everything into api calls, logic, helper methods, etc.