Python's json.dumps method encodes NaN into JSON output as NaN, which is not actually valid JSON, and the API's parser can't process that, so the client will get back an HTTP 400 error if a NaN value is accidentally included in the request. The python library should specify allow_nan = False in the json.dumps call so that the calling code gets a ValueError instead of a strange API error.