Added exception handling for parsing responses.