update code controller for new rest api