workup of weather api function