fixed REST code