Get API key-value working and fix relevant tests.