Updated check for authorization error. (should be 401 was 501)
Added CPP example/client.