insight REST API retry

this adds retry to REST API in case of failure.