Move api struct into entity from controller