Index API in JS working