added logic to handle search from the webserver
have basic searching working