Add reply controller function for handling replies.