Updated endpoint to v2 and fixed get_index