js api test bug fix