[rest] add unit tests