use to_json instead of inspect

fixes #58