Move retries to the client
Adding a flask error handle for mbs api