refactored weather api