Tweak imports in tutorial.  Fixes #597.
Raise assertion errors if @api_view decorator is applied incorrectly. Fixes #596.