Add script_root to the returned url (/app in http://example.com/app/api_call)