added average price api call