Issue #2228149 by eshta: moved trailing slash handling for api url to constructor.