Fix failure to share under rails4, due to missing json root element

Add spec, and fix root element no longer being in the json under rails4.