Add reply handler to the API