fixed url string escaping problem
refactored code to use new http library
UI updates take place on main thread, thanks @tadimsky for fixing this