improved restful.py