DocCode: refactored purge/reset logic to common webApiCommand