Error handling is completed in Server file. In two method code is added.