Expose the resulting json object to make it modifyable

Some internal changes. This PR is mostly for testing.