Fix and improve api view template