I'm using the Javascript SDK, and code uploads some files, creating their parent folders, then creates a sharing link of one of the parent folders. But because javascript is asyncronous, the files haven't been uploaded, hence creating the folder, so creating the sharing link returns a path not found error. How can I get around this problem?