REST logic