Adding CORS support
Lots of repair work
Various model fixes