Error checking for advanced search

Part of OOIION-1413
Merge pull request #78 from Bobfrat/internalServerErr-rev2

Error checking for advanced search