fix db indices. parse ambient data