Ensure empty object is sent as JSON if specified