fixed code so that diffusion to a local restful server works