Refoctor leo_manager_api:purge