Added more specs and JSON serialisation.