Use the API for orgs
Improved debug
Enabled promise error handling