improve webapi.vim: remove duplicated function