Updated code and routes