Added a static class with a helper method to unpack a clientresponsefailure exception into an ApiFailureMessage

This is tricky (it turns out) because although we are expecting the api to return a json object it might not if the serlvet is sick so this code does some inspection of content types to try and do the right thing