more changes to rest.py