changed name, cleaned up js

pulled success and error into their own functions outside, changed name
to local weather