added data structure and api call