completed and testing threads api. both get and insert.