User defined JSON serializer