roughly laid down the redistent API