Refactoring of weather Search API using AngularJS