fixing api call