Many API fixes for GET_KEY and GET_KEY_IDS