write public function to call api