Removed unused imports, and added 401/403 exceptions