redone plugin code
added rest plugin