make controller work with apis methods