Fix api key saving