Improved error propagation from api to cli