Removed the if block and just return the expression directly.
Whitespace.
Refactored out the header creation to base-headers in order to be able
to re-use that logic in other API request functions.
Whitespace.
Added the create directory function.
Export the create directory function.
Check both the status code and the ETag header when uploading files.