add some API code