Adds index action and template and various bug fixes