Rejig how api_keys are passed