refactoring
settings for username and api key plus some refactoring