Address issues raised in code review.
Distinguish between server and client errors in the retry logic.

A server error (e.g. 500 errors) should be retried since a second
identical request may elicit a completely different result. A client
error (e.g. 400 errors) should not be retried since a second identical
request would elicit an identical result.