added routes and changed templates to support editing