mclinic-api: update algorithm to accommodate changes in the object