improved error handling on some promises
add host, port and api version arguments to the CLI