fixed bugs and better validation of webservice