add spike arrest middleware and tests