adding type registration, exception handling for json parsing