Change startApi to private function