is API key valid method