fixed syntax errors and made api consistent with others