implemented predictions in webservice
refactoring in webservice