refactor test of sample api module