addingg REST pattern on to code