urlencode added to path, add closures at ajax calls