implement create,update function in controller