improved on the rest endtoend framework