fix(api): errors propagation

Make sure errors are propagated along the promises chain.