optimizing sync speed be reorganizing database, altered registration function to save id before calling register api on oris4