Add login_required decorator to methods

Without this, anyone could call these methods if they knew the URL to call. This check will raise a 403 forbidden if they attempt to call these views without authorization.

Also formatting and other cleanup.
Imports, formatting
Imports, formatting
Formatting, unused imports
Formatting
Formatting