Refactored Storage API upload to work correctly.