add tests for main api