IndexService refactoring

Refactored the service interface and added corresponding unit test