fix api_key check presence