[Ajax]: set undefined to null in toJSON method