adding null-checks when retrieving username and/or API token
first pass at integrating with the "Credentials" plugin.