Set correct response code on submit error