call correct api