Quote identifier in API key query.
Allows multiple derivative types.
Replaced unusual "case" condition by a "if".