Add option to remove api key, fix bugs related to key management.