move api call to app folder