add rpc code
Merge pull request #12 from jgpawletko/rpc

add rpc code