fixed indexapi.js for ctest #869