change gen_hash to ht_gen_hash
add db definition and API imple,in the process