Change RPC to RestDataSource and fix a bug