[sync] wrap sqlite conn and rest api in a session class