Implement a fallback call to the `to_json` method on arbitrary objects