Refactor error rescue blocks

This pull request provides suggestions on refactoring the controller actions to extract the error rescue logic and thereby making it easier for the user to focus just on the API calls being demonstrated.

Using the Rails rescue_from controller method I extracted the error rescue login into controller helper methods.
This solution relied on using redirect_to :back in the helper methods. This method is difficult to test so I wrapped it in a method called redirect_to_back_or_default which permitted me to run tests without having to stub the HTTP referrer in the ENV variable.

Also as a minor change I renamed the actions for returning a single resource from view to show following Rails convention.