Rewrite sendrequest as private func