transformed into webservice so js can consume json