Sorry can I ask, I've just had a look at the response and the rest API does give produce an error: {description":"Invalid File","summary":"error"}, but the response is a 500 internal server error.
In this case, I guess it the server response should be 200, is that correct way to handle it? 200 with an error message in the body?