resolve unbalanced } in non-200 HTTP codes