Introduce generate_public_key(), generate_private_key(), get_token() and improved API key generation