LPS-46582 added correct response status codes in case of error