FIX: generate API key not working

Meta: [Generate API key not working](http://meta.discourse.org/t/generate-api-key-not-working/5830)

This fixes a regression regarding the generation of the API key.