JSON debuging and integration

Solved bugs present when converting to JSON instead of custom database
parsers.