added POJO encoder and decoder.