Better error handling and jsonp support