new api and new test

new api, new test and php syntax error fixing in some systems