Refactor exception handling
Add instance parameter to upload tool