Refactored the API model.