moved logic for controllers out of API controller and into the actions. need to read about designing an efficient api