added a training controller and CORS support