change the apis as chainable programming