Key refactor

Refactored APIKey