Now it parses to right error representation. Also fix that right
exception for error is not thrown on api call.
Signed-off-by: Yahor Berdnikau <egorr.berd@gmail.com>
As this call should return byte stream: I've introduced helper method
in client to do the actual call and parse possible json error response.
Signed-off-by: Yahor Berdnikau <egorr.berd@gmail.com>