second slew of fixes (mostly ensuring apiKeyId is never ommitted)