Added CORS support
Added hasData property, fixed max_trains behavior