Not building due to type issue
Use type switching to genericize JSON marshall

* Add documentation