Added Exceptions and changes in SearchService.java