Changed Convert class into Conversion service
added toJson function to the conversion service