integrated forecast() with the rest of the app (api and main page)