added respond to json to index method