Refactor api test client classes.