added rest module and made changes to support the new rest module code