remove unused imports
remove unused imports
set content type only if not already set
shifted error handling in an controller