Weird but smarter API key handler.