Fix imports
More work on json backend
Add unit tests for json backend