[api] extract links filtering and html generation to api view level