converting add_distributor api to synchronous api and updating unit test