refactor fuzz testing

I was thinking of fuzz-testing the REST API, but that turned out to be more difficult than useful.  In the process, I made this refactor.