use automap and new function to call api.

-