cleaned up the routing and added authentication for edit links