Deprecate api

fixed #415