Using the to_json options to pass in the base_url instead of the nasty hack.