added rate API, implemented actual protocol