moved to an API model where both server and cli tools use the api for their common functions