fix error handling at client/api and investigate type error at ngflow