Json schema

Closes #248