Post controller changes.

Moved the view handling code out into another function.
Fixed server error when /view/ requested.