Fix url handling in apiHelper