add controller methods and fix data no id error