rewrote api script; updates styles.