minor refactor for maintaining server response in errors