client: Parse PT error object and return it

The error object is now accessible when an error is returned from the
API call and the error is of type ErrAPI. The Err field then points to
the error, i.e. it's ErrAPI.Err

Signed-off-by: Ondřej Kupka <ondra.cap@gmail.com>
errors: Fix a wrong variable name

Signed-off-by: Ondřej Kupka <ondra.cap@gmail.com>