writing a webservice in php