Rest framework

Tweaks Fixes #6 Fixes #7.