Initial test refactoring (focusing on test_api) very promosing, much more work to-do