Migrate

Initial (and very dirty) draft for REST API, check wiki for basic documentation