fix(api): return after write error 400 to header.