fix some basic things on the new design of amuzi_search and make it so that the connection is closed after each search