Add new API to fix #2