ApiComtroller::getAffectedModels() improvement