Added a function to request an API key from the server.