Tidied up main python file, moved upload endpoint