Ensure data is sent as json

Fixes #47