refactored file and folder creation to require less API calls.