make api test script work with bitmask and print log