implements http handler of json