Added caching into retrieval and shortening of URLs as a trait
Correct caching logic to ensure consistent type of what was being cached