made api call properly