Add and test .error-code for locked view and add test for bad JSON