dynamically fill controller prototype based on array