Add hosting_network_rest_call helper function and replace the old connect function everywhere.