misc cleanups in REST code, updated CHANGES wrt. rest api

pep8 fixes, typos, import fixes (remove unused, add missing), removed commented code, fix exception handler