Fix the API logic.