Check responses for errors and throw appropriate exceptions