adds delete and update functions to the factory and to the main and detail controllers respectively