added rest functionality