REST API and persistence

WIP

Fix web tests