updated rest.py