Updated the URL Encode part.

URLEncode.encode(String string) is deprecated.
New method throws UnsupportedEncodingException and need 2 parameter. Updated the same.