modified php service. Added Excpetion handling to app