refactored tutorial to give back json or api
fixed a typo
refactor to class-based views