working api call but needs promises