new approach to parsing and adding a trailing slash to urls