removed extra layers and made api async