pass api to views