Added try/catch for response handling