updated code and changed routes to allow only show and index