REST API and persistence

WIP
Web tests can't get ApplicationContext, so they are skipped for now. Spring configuration needs refactoring?