add new bare_view api,fixed some bugs, add some tests