REST API and persistence

WIP