Refactored code to clean the path for the dropbox api.