Added Error Handling for JSON