Update threadExists() method to check if thread_id is null
Update thread creation / update methods