Update shortened url code and add controller tests