moved errors to errors.py, changed local imports to relative