Add encode and decode url helper functions