Refactor with rest module

Signed-off-by: Jia-He Jou <joujiahe@gmail.com>