DHIS2 relation api is returning a 200 http status but not all relations are added

I need to upload huge excel data to DHIS2.

I have 2 excels. The first one contain general information about each family, with an id.
At the second excel, I have detailed info about each member of each family, connected through the related first excels ID.

The data is being properly added to DHIS2 and enrolled.

So the first excel go row by row, add it to an entity, then enroll it into a program. Then a loop is being made to loop over the second excel to add members of each family and enroll it into another program.

The problem is with the relation ship addition. The response of the each relation api:

httpStatusCode=200 which means data is being added.

But only 90% of the relations are practically shown at the dhis2.

Here is my api call:

addRelation(hh_id, mbr_id, data){      

    

    this.api.addRelation(hh_id, data).subscribe(

      (response) => {

        if (response['httpStatusCode'] == 200 && response['httpStatus'] == "OK"

                            && response['message'] == 'Import was successful.') {

          console.log(hh_id, mbr_id)

          console.log(response)

        }

      },

      (error) => {

        console.log(error)

      }

    );

  }

No error at all, but some of the relations are missing.

In the image below, only 3 relations being added, despite the fact that the 4 api calls returned a positive response:

Capture

Should I put a timer between each relation api call ?