converting index view to class-based view (closes #1)