Properly abort API calls if api_key is invalid

* Fixes an issue where any api_key would be validated
* Now returns user ID upon success, aborts script processing with error
  on fail
Merge pull request #79 from TheSerapher/api-auth

Properly abort API calls if api_key is invalid