Add handling of email and api key on command line
Refactoring and additional checks
Rename