More refactoring, upload activity to use API