check for valid json

@jbarrett