Added database searching and updated the look for listing queries