https://stackoverflow.com/questions/19970301/convert-javascript-object-or-array-to-json-for-ajax-data/24728537#24728537