Add friendly url, change routes and refactor code