mattdrayer/api-invalid-test-cleanup: Profiler-driven refactoring

@chrisndodge -- here are the follow-on changes being pulled out of the profiler PR