Fixed #2 completed functional tests for apis.