fix syntax err
move internals into API