finish the common ApiGet and ApiPost method and unit test