Index API and tests