added some code for json adapter to phalcon