Add api function for code run and new Referee class for using it.