fixed the elastic api call