move JSON serialisation implicits to companion objects