Added error handling for invalid function parameters, added Search function, removed print url statements