working on the controlleres to work like and api