Fixed json parsing with error handling

Fixed #64