Refactor with rest module.

Signed-off-by: Johnson Jou <johnson@unispace3d.com>