made spawn rpc switchable between ajax and jsonp