added an api call to flush all chains when called with keyword all