refacoring api test script