Topic and admin dashboard not retrieving data properly when using prefix

The AJAX calls do not use Discourse.getURL and fail when running discourse with a prefix.