Caught api exceptions, use rawurlencode instead of urlencode