Reorganized index, and fixed the API tests