added REST logic