HttpApi test refactoring