outsources error code in errors.py
adds /api/0/user/logout endpoint