Clean up URL to avoid redirect to trailing slash
Break out setup so it can be called later for API functions