add a json handler for posts