Make postJSON accept a promise for a data object