refactor private methods, bind listeners on api ready