api function connection