fixed bugs with updating data, updated api