Fix typo in log upload
Minor refactoring for network requests.