rewrite the test cases code, and new feature secureAPI.js (no test yet)