Improve model and fix plumbing of the server