extract implementation from pivot_clients_api