Add a couple of unit tests; fix mistakes in rest_api; switch to json answers