Add tests for API module

Change-Id: If95587e174d3b826af01cbfb3542480f22b34a81