#266 creating interface between REST layer and data layer
+ other minor changes