Adding rest support

Adding code for rest support