adapting cli to new API