Add retry middleware to  API repository