Update apikey management
Add a test to check that adding a duplicate apikey fails