fix keygen() to return api_key as documented.