Write JSON using a POJO model