better encapsulation for model classes, using blocks for http response handling