check for username and api_key