Added curl exception handling to getauthtoken
Fixing command-line args and adding curl error handling