[api] avoid error 500 when sending invalid XML to create a request